



<HTML>

<HEAD>

<LINK rel="stylesheet" href="../exer.css">

</HEAD>

<BODY>

<H1>

Data Structures, Algorithms, & Applications in C++<BR>

Chapter 2, Exercise 38<BR>

<BR>

</H1>





<dl compact>

<dt> (a)

<dd>

Program <em>A</em> is faster than program <em>B</em> when

<em class=var>1000n < 10n<sup>2</sup></em>, that is when

<em class=var>n > 100</em>.

<br><br>

<dt> (b)

<dd>

Program <em>A</em> is faster than program <em>B</em> when

<em class=var>2n<sup>2</sup> < n<sup>3</sup></em>, that is when

<em class=var>n > 2</em>.



<br><br>

<dt> (c)

<dd>

Program <em>A</em> is faster than program <em>B</em> when

<em class=var>2<sup>n</sup> < 100n</em>, that is when

<em class=var>n < 10</em>.



<br><br>

<dt> (d)

<dd>

Program <em>A</em> is faster than program <em>B</em> when

<em class=var>1000n log<sub>2</sub>n < n<sup>2</sup></em>, that is when

<em class=var>n > 1000 log<sub>2</sub>n</em>.

The switchover point is between <em class=var>2<sup>13</sup></em> and

<em class=var>2<sup>14</sup></em>.

</dl>



</FONT>

</BODY>

</HTML>

